

******************************************************************************************************************************************************************************************************  
******************************************************************************************************************************************************************************************************
*******************************************************************************  IDENTIFICATION MODELS ***********************************************************************************************
******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************


******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************
************************************************************************************************ BASELINE IV REG MODELS ******************************************************************************
******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************


clear
use "Brancati_isodly_final.dta"

xtset isonum 


**Table 28: IV Models -- Baseline Models**
** MODEL 1**
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag entrance exit (lockdown_oxf50=sumborder_deaths_wklag abspandistance), fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso) 
*Reduced Form* 
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance, fe

**MODEL 2* 
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag entrance exit (oxfstringindex=sumborder_deaths_wklag abspandistance), fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form* 
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance, fe


**MODEL 3**
xtpoisson rebelattk_isodly oxfstringindex stateattk_isowkly_lag deaths_wklag entrance exit, fe  
gen sample = e(sample)  
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag entrance exit (lockdown_oxf50=sumborder_deaths_wklag abspandistance) if sample ==1, fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso) 
*Reduced Form* 
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance if sample ==1, fe 


**MODEL 4* 
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag entrance exit (oxfstringindex=sumborder_deaths_wklag abspandistance) if sample ==1, fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form* 
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance if sample ==1, fe 

drop sample



******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************
************************************************************************************************ INSTRUMENT TESTS ************************************************************************************
******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************



**TABLE 29: PLACEBO TEST**

xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag entrance exit (lockdown_oxf50=sumborder_deaths_wklag abspandistance), fe i(isonum) first
gen esample=e(sample)

gen Asia = 0 if region != ""
replace Asia = 1 if region == "Asia"

gen AsiaOceania = 0 if region != ""
replace AsiaOceania = 1 if region == "Asia"
replace AsiaOceania = 1 if region == "Oceania"

gen Africa = 0 if region != "" 
replace Africa = 1 if region == "Africa"

gen Europe = 0 if region != "" 
replace Europe = 1 if region == "Europe"

gen LAC = 0 if region != "" 
replace LAC= 1 if region == "Latin America and the Caribbean"

gen NA = 0 if region != "" 
replace NA= 1 if region == "North America"

**Model 1*
logit Asia sumborder_deaths_wklag abspandistance if esample==1, cluster(isonum)

**Model 2*
logit AsiaOceania sumborder_deaths_wklag abspandistance if esample==1, cluster(isonum)

**Model 3*
poisson rebelattk_isodly Asia Africa Europe LAC NA if esample==1

**Model 4*
poisson rebelattk_isodly AsiaOceania Africa Europe LAC if esample==1



**TABLE 30: COVARIATE BALANCE TEST**
covbal  produces the same results: instrument must be dichotomized. It also produces var-ratio.
ssc install stddiff

*Column 1*
gen lnrealGDP_lag = ln(realGDP_lag)

stddiff stateattk_isowkly_lag if esample==1, by(lockdown_oxf50) abs
stddiff deaths_wklag if esample ==1, by(lockdown_oxf50) abs 
stddiff entrance if esample ==1, by(lockdown_oxf50) abs
stddiff exit if esample ==1, by(lockdown_oxf50) abs
 

*Column 2*
gen disumborder_deaths_wklag = 0 if sumborder_deaths_wklag <=0 & sumborder_deaths_wklag != .
replace disumborder_deaths_wklag = 1 if sumborder_deaths_wklag >=1 & sumborder_deaths_wklag != .

stddiff stateattk_isowkly_lag if esample==1, by(disumborder_deaths_wklag) abs
stddiff deaths_wklag if esample ==1, by(disumborder_deaths_wklag)  abs 
stddiff entrance if esample ==1, by(disumborder_deaths_wklag) abs
stddiff exit if esample ==1, by(disumborder_deaths_wklag) abs


*Column 3*
gen diabspandistance = 0 if abspandistance <=456 & abspandistance != .
replace diabspandistance = 1 if abspandistance >=457 & abspandistance != .

stddiff stateattk_isowkly_lag if esample==1, by(diabspandistance) abs
stddiff deaths_wklag if esample ==1, by(diabspandistance)  abs 
stddiff entrance if esample ==1, by(diabspandistance) abs
stddiff exit if esample ==1, by(diabspandistance) abs



******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************
************************************************************************************************ ADDITIONAL CONTROLS *********************************************************************************
******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************


*TABLE 31: IV Models- Additional Controls*

************************
*District-level Controls*
************************

clear
use "Brancati_admndly_final.dta"
xtset isonum

** MODEL 1** 
xtivreg rebelattk_admdly stateattk_admwkly_lag deaths_wklag entrance exit popdensity000 popmil sizekm2 state_territory contested_territory (lockdown_oxf50=sumborder_deaths_wklag abspandistance), fe  i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form*  
xtreg rebelattk_admdly sumborder_deaths_wklag abspandistance, fe


** MODEL 2**
xtivreg rebelattk_admdly stateattk_admwkly_lag deaths_wklag entrance exit popdensity000 popmil sizekm2 state_territory contested_territory (oxfstringindex=sumborder_deaths_wklag abspandistance), fe  i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form*  
xtreg rebelattk_admdly sumborder_deaths_wklag abspandistance, fe

********************
* Economic Controls *
*********************
clear
use "Brancati_isoqtrly_final.dta"
xtset isonum
gen lnrealGDP = ln(realGDP)
gen lnrealGDP_lag = ln(realGDP_lag)

** MODEL 3 (GDP)**
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag lnrealGDP_lag (lockdown_oxf50=sumborder_deaths_wklag abspandistance), fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form*  
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance, fe 

** MODEL 4 (GDP)** 
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag lnrealGDP_lag (oxfstringindex=sumborder_deaths_wklag abspandistance), fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form*  
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance, fe 

** MODEL 5 (UNEMPLOYMENT)**   
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag unemploy_lag (lockdown_oxf50=sumborder_deaths_wklag abspandistance), fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form*  
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance, fe

** MODEL 6 (UNEMPLOYMENT) ** 
xtivreg rebelattk_isodly stateattk_isowkly_lag deaths_wklag unemploy_lag (oxfstringindex=sumborder_deaths_wklag abspandistance), fe i(isonum) first
*Sargan-Hansen Statistic*
xtoverid, cluster (iso)
*Reduced Form*  
xtreg rebelattk_isodly sumborder_deaths_wklag abspandistance, fe




******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************
************************************************************************************************ SUBSET ANALYSIS *************************************************************************************
******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************


clear
use "Brancati_isoqtrly_final.dta"


*TABLE 32: Subpopulation Analysis (Poisson, FE)*
xtset isonum

*Model 1*
xtpoisson rebelattk_isodly lockdown_oxf50 stateattk_isowkly_lag deaths_wklag entrance exit if seqdays >=801 & abspandistance >=1 & abspandistance <=30, fe 
margins, at(lockdown_oxf50=1) predict(nu0)
   
*Model 2*
xtpoisson rebelattk_isodly lockdown_oxf50 stateattk_isowkly_lag deaths_wklag entrance exit if seqdays >=801 & abspandistance >=1 & abspandistance <=60, fe 
margins, at(lockdown_oxf50=1) predict(nu0)

*Model 3*
xtpoisson rebelattk_isodly lockdown_oxf50 stateattk_isowkly_lag deaths_wklag entrance exit if seqdays >=801 & abspandistance >=1 & abspandistance <=90, fe
margins, at(lockdown_oxf50=1) predict(nu0)

*Model 4*
xtpoisson rebelattk_isodly lockdown_oxf50 stateattk_isowkly_lag deaths_wklag entrance exit if year >=2000, fe  



*TABLE 33: Subpopulation Analysis-Alternative Lockdown Measures (Poisson, FE)*

*Model 1*
xtpoisson rebelattk_isodly oxfstringindex stateattk_isowkly_lag deaths_wklag entrance exit if seqdays >=801 & abspandistance >=1 & abspandistance <=30, fe 

*Model 2* 
xtpoisson rebelattk_isodly oxfstringindex stateattk_isowkly_lag deaths_wklag entrance exit if seqdays >=801 & abspandistance >=1 & abspandistance <=60, fe

*Model 3*  
xtpoisson rebelattk_isodly oxfstringindex stateattk_isowkly_lag deaths_wklag entrance exit if seqdays >=801 & abspandistance >=1 & abspandistance <=90, fe  

*Model 4*  
xtpoisson rebelattk_isodly oxfstringindex stateattk_isowkly_lag deaths_wklag entrance exit if year >=2000, fe  



**Table 34: Nonstate Actor Violent Events (DiD)****

*Model 1 (30 days)*
xtdidregress (rebelattk_isodly) (lockdown_oxf50) if seqdays <=831, group(isonum) time(seqdays) 

*Model 2 (30 days)*
xtdidregress (rebelattk_isodly stateattk_isowkly_lag deaths_wklag) (lockdown_oxf50) if seqdays <=831, group(isonum) time(seqdays)

*Model 3 (60 days)*
xtdidregress (rebelattk_isodly) (lockdown_oxf50) if seqdays <=861, group(isonum) time(seqdays) 

*Model 4 (60 days)*
xtdidregress (rebelattk_isodly stateattk_isowkly_lag deaths_wklag) (lockdown_oxf50) if seqdays <=861, group(isonum) time(seqdays)

*Model 5 (90 days)*
xtdidregress (rebelattk_isodly) (lockdown_oxf50) if seqdays <=891, group(isonum) time(seqdays) 

*Model 6 (90 days)*
xtdidregress (rebelattk_isodly stateattk_isowkly_lag deaths_wklag) (lockdown_oxf50) if seqdays <=891, group(isonum) time(seqdays)


*Parallel Trends Test
gen lockdown_oxf50_seqdays = lockdown_oxf50*seqdays
reg rebelattk_isodly seqdays lockdown_oxf50  lockdown_oxf50_seqdays




*TABLE 35: Nonstate Actor Violent Events (Event Study)*  

*Model 1 (30 days)
did_multiplegt_dyn rebelattk_isodly isonum seqdays lockdown_oxf50 if seqdays <=831, placebo (1)

*Model 2 (30 days)
did_multiplegt_dyn rebelattk_isodly isonum seqdays lockdown_oxf50 if seqdays <=831, controls(stateattk_isowkly_lag deaths_wklag) placebo (1)

*Model 3 (60 days)
did_multiplegt_dyn rebelattk_isodly isonum seqdays lockdown_oxf50 if seqdays <=861, placebo (1)

*Model 4 (60 days)
did_multiplegt_dyn rebelattk_isodly isonum seqdays lockdown_oxf50 if seqdays <=861, controls(stateattk_isowkly_lag deaths_wklag) placebo (1)

*Model 5 (90 days)
did_multiplegt_dyn rebelattk_isodly isonum seqdays lockdown_oxf50 if seqdays <=891, placebo (1)

*Model 6 (90 days)
did_multiplegt_dyn rebelattk_isodly isonum seqdays lockdown_oxf50 if seqdays <=891, controls(stateattk_isowkly_lag deaths_wklag) placebo (1)



******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************
*************************************************************************************** MATRIX COMPLETION  METHOD*************************************************************************************
******************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************

**Table 36: See "Brancati_APNDX_ID_fectMC_R"
